<%-- 
    Document   : details
    Created on : Dec 29, 2011, 11:16:08 PM
    Author     : user
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@include file="../jspf/header.jspf" %>

<%
    HashMap product = (HashMap) session.getAttribute(Static.product);
    HashMap category = (HashMap) session.getAttribute(Static.category);
    HashMap subCategory = (HashMap) session.getAttribute(Static.subCategory);

    String photo = ((String) product.get("Photo")).compareTo("") != 0 ? (String) product.get("Photo") : "imagenotfound.jpg";
    
    %>

<div style="width: 100%">
    <p class="pageTitle"><strong><%
        out.println(product.get("Name"));
            %></strong></p>
    <br />
    <div style="width: 100%">
        <hr />
    </div>
    <div style="padding: 10px 0px 10px 0px">
        <div style="width: 30%; float: left">
            <div style="margin: 10px 0 10px 0"><a id="myphoto"
                                                  href="img/products/<%
                                                      out.print(photo);
                                                  %>"> <img src="img/products/<%
                                                      out.print(photo);
                        %>" width="140px" height="120px" alt="2" /></a></div>

            <div id="div_quantity" class="txt3"
                 style="text-align: center; padding: 10px 0px 10px 0px"><label
                    for="quantity"><b>Cantiate:</b></label> <input type="text"
                    class="tbProductQuantity txt3" id="quantity" name="quantity"
                    <%
                        try {
                            if ((Double)product.get("Quantity") > 0) {
                                out.println("value=\"1\" onkeyup=\"CheckQuantity()\" />");
                            } else {
                                out.println("value=\"0\" disabled=\"disabled\" onkeyup=\"CheckQuantity()\" /> <br /><label class=\"error\">Nu mai sunt produse in cos</label>");
                            }
                        } catch (Exception ex) {
                            String error = ex.getMessage();
                        }

                    %>
                    <br /></div>
            <div style="text-align: center; padding: 0px 0px 10px 0px">
                <%

                    try {
                         if ((Float)product.get("Quantity") > 0) {
                            out.println("<img src=\"img/site/add.gif\" alt=\"?\" style=\"cursor: pointer\" title=\"Adauga in cos\"	onclick=\"redirect('cart?action=add&id=" + product.get("ProductID") + "&quantity=\')\" />");
                        } else {
                            out.println("<img src=\"img/site/add.gif\" alt=\"?\" title=\"Nu exista stoc pentru acest produs\" disabled=\"disabled\" />");
                        }
                    } catch (Exception ex) {
                        String error = ex.getMessage();
                    }
                %>
            </div>
        </div>
        <div style="width: 70%; float: left">
            <div style="margin-left: 40px; line-height: 25px" class="txt1">
                <div><b><%                    out.println(category.get("Name") + "/ " + subCategory.get("Name"));
                        %></b></div>
                <div><b>Pret: <% out.print(product.get("Price"));%> RON </b></div>
                <div><b>Cantitati disponibile: <% out.print(product.get("Quantity"));%></b></div>
                <div style="width: 350px; display: inline-block;"><b>Descriere: <% out.print(product.get("Description"));%></b></div>
            </div>
        </div>
        <div style="width: 100%; float: left"></div>
    </div>
    <div style="width: 100%; float: left">
        <hr />
    </div>
</div>

<%@include file="../jspf/footer.jspf" %>

